package cn.peach.user.controller;

import cn.peach.basic.util.AjaxResult;
import cn.peach.basic.util.PageList;
import cn.peach.user.domain.User;
import cn.peach.user.query.UserQuery;
import cn.peach.user.service.IUserService;
import cn.peach.user.service.IVerifycodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/veri")
public class VerifycodeController {

    @Autowired
    private IVerifycodeService verifycodeService;

    /**
     * Map来接收参数
     * @param param
     * @return
     */
    @PostMapping("/smsCode")
    public AjaxResult smsCode(@RequestBody Map<String, String> param) {
        try {
           verifycodeService.smsCode(param);
            return AjaxResult.me();
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.me().setMessage("垃圾系统404");
        }
    }
}
